package com.slz3.business.module.configManagement.conZoneManage.steward;

import com.slz3.business.module.configManagement.conZoneManage.domain.ConZoneManage;
import com.slz3.business.module.configManagement.conZoneManage.domain.ConZoneManageCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

@Component
public class ConZoneManageResponse {

    @Resource
    private ConZoneManageResController conZoneManageResController;

    public  Mono<ServerResponse> add(ServerRequest req) {
        return req.bodyToMono(ConZoneManage.class).flatMap(conZoneManage ->
                conZoneManageResController.add(req, conZoneManage)
        );
    }

    public  Mono<ServerResponse> delete(ServerRequest req) {
        return req.bodyToMono(ConZoneManageCondition.class).flatMap(conZoneManageCondition ->
                conZoneManageResController.delete(req, conZoneManageCondition)
        );
    }

    public  Mono<ServerResponse> modify(ServerRequest req) {
        return req.bodyToMono(ConZoneManage.class).flatMap(conZoneManage ->
                conZoneManageResController.modify(req, conZoneManage)
        );
    }


    public  Mono<ServerResponse> list(ServerRequest req) {
        return conZoneManageResController.list(req);
    }

    public  Mono<ServerResponse> info(ServerRequest req) {
        return conZoneManageResController.info(req);
    }

    public  Mono<ServerResponse> choice(ServerRequest req) {
        return conZoneManageResController.choice(req);
    }

    public  Mono<ServerResponse> auditSubmit(ServerRequest req) {
        return req.bodyToMono(ConZoneManageCondition.class).flatMap(conZoneManageCondition ->
                conZoneManageResController.auditSubmit(req, conZoneManageCondition)
        );
    }

    public  Mono<ServerResponse> audit(ServerRequest req) {
        return req.bodyToMono(ConZoneManageCondition.class).flatMap(conZoneManageCondition ->
                conZoneManageResController.audit(req, conZoneManageCondition)
        );
    }

    public  Mono<ServerResponse> auditReject(ServerRequest req) {
        return req.bodyToMono(ConZoneManageCondition.class).flatMap(conZoneManageCondition ->
                conZoneManageResController.auditReject(req, conZoneManageCondition)
        );
    }

    public  Mono<ServerResponse> usingEnable(ServerRequest req) {
        return req.bodyToMono(ConZoneManageCondition.class).flatMap(conZoneManageCondition ->
                conZoneManageResController.usingEnable(req, conZoneManageCondition)
        );
    }

    public  Mono<ServerResponse> usingDisable(ServerRequest req) {
        return req.bodyToMono(ConZoneManageCondition.class).flatMap(conZoneManageCondition ->
                conZoneManageResController.usingDisable(req, conZoneManageCondition)
        );
    }   

}
